package zoo.product.dao;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;

import zoo.member.admin.pro.domain.AdminProductCommand;
import zoo.product.domain.ProductCommand;

public class ProductDaoImpl extends SqlSessionDaoSupport implements ProductDao{

	@Override
	public List<ProductCommand> getProductList(Map<String, Object> map) {
		List<ProductCommand> list = getSqlSession().selectList("selectProMemberList", map);
		return list;
	}

	@Override
	public int getProductCount(Map<String, Object> map) {
		return (Integer)getSqlSession().selectOne("selectProMemberCount", map);
	}

	@Override
	public ProductCommand selectProMemberBoard(Integer p_code) {
		ProductCommand selProCommand = (ProductCommand)getSqlSession().selectOne("selectProMemberBoard", p_code);
		return selProCommand;
	}

	@Override
	public void updateProHit(Integer p_code) {
		getSqlSession().update("updateProHit",p_code);
	}
	
	@Override
	public void updateProBest(Integer p_code) {
		getSqlSession().update("updateProBest",p_code);
	}
	
	@Override
	public List<ProductCommand> searchProductList(Map<String, Object> map) {
		List<ProductCommand> list = getSqlSession().selectList("searchProMemberList", map);
		return list;
	}

	@Override
	public int searchProductCount(Map<String, Object> map) {
		return (Integer)getSqlSession().selectOne("searchProMemberCount", map);
	}

	@Override
	public String selectOption(Integer p_code) {
		return getSqlSession().selectOne("selectOption", p_code);
	}

	@Override
	public String hitSearch(Map<String, Object> map) {
		return (String)getSqlSession().selectOne("hitSearch",map);
	}

	@Override
	public void updateHitBest(Map<String, Object> map) {
		getSqlSession().update("updateHitBest",map);
	}
	
}
